import requests from "./request";

// 登录接口
export function login(memberNum, password, code, uuid) {
	return requests({
		url: '/auth/login',
		headers: {
			isToken: false
		},
		method: 'post',
		data: {
			memberNum,
			password,
			code,
			uuid
		}
	})
}

// 退出登录
export function logout() {
	return requests({
		url: '/auth/logout',
		method: 'delete'
	})
}


// 获取登录成员工号
export function getMemberInfo() {
	return requests({
		url: '/system/member/getMemberNum',
		method: 'get'
	})
}

// 获取成员列表
export function queryMemberList(queryParams, searchMemberForm) {
	return requests({
		url: '/system/member/queryMemberList',
		method: 'get',
		params: {
			...queryParams,
			...searchMemberForm
		}
	})
}

// 获取成员信息
export function queryEditMemberInfo(id) {
	return requests({
		url: '/system/member/queryEditMemberInfo/' + id,
		method: 'get'
	})
}

//  新增成员
export function addMember(form) {
	console.log(form)
	return requests({
		url: '/system/member/addMember',
		method: 'post',
		data: {
			member_id: form.memberId,
			member_num: form.memberNum,
			password: form.password,
			role: form.role
		}
	})
}

// 修改成员
export function editMember(form) {
	return requests({
		url: '/system/member/modifyMember',
		method: 'put',
		data: {
			member_id: form.memberId,
			member_num: form.memberNum,
			password: form.password,
			role: form.role
		}
	})
}

// 删除成员
export function deleteMember(id) {
	return requests({
		url: '/system/member/deleteMember/' + id,
		method: 'delete'
	})
}